docom()
{
    code=$1

echo "================== doing docom "$code" ================="
echo
echo

#.L./ #needed
    g++ $code.C  \
-g -O3 -Wall -Werror \
-I$ROOTSYS/include \
$(root-config --libs) -lMinuit -L./  -lTTreeStream \
 -o $code
}

doTTreeStream()
{
echo "============= doing doTTreeStream ==================="
echo
echo 

rm -f libTTreeStream.so  *.o *Dict.* 

g++ -I$ROOTSYS/include  -fPIC -c TTreeStream.cxx -o TTreeStream.o

rootcint -f TTreeStreamDict.cxx -c -I$ROOTSYS/include  TTreeStream.h TTreeStreamLinkDef.h 

g++ -I$ROOTSYS/include  -fPIC -c TTreeStreamDict.cxx -o TTreeStreamDict.o

g++ -shared -O3 -Wall -Werror \
-I$ROOTSYS/include \
$(root-config --libs) \
  TTreeStream.o TTreeStreamDict.o -o libTTreeStream.so

rm -f  TTreeStream.o TTreeStreamDict.h TTreeStreamDict.cxx TTreeStreamDict.o 
}

doTTreeStream

docom fith

docom mn2d

#docom drawpar

echo "done!"



